using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using Microsoft.ApplicationBlocks.Data;
using System.Xml;

namespace Customs.Components.SXXK.ThanhKhoan
{
    public class DanhSachNPLNopThue
    {
        public static DataSet GetHoSoThanhKhoanOfLanThanhLy(string maHaiQuan, string maDoanhNghiep, int lanthanhly)
        {
            string connectionString = ConnectionManager.GetConnectionString("SXXK", maHaiQuan);
            string query = "SELECT * FROM DNPLNTMAN WHERE MA_HQ = @MA_HQ AND MA_DV = @MA_DV AND LAN_TL=@LAN_TL";

            SqlParameter[] parameters = new SqlParameter[3];

            parameters[0] = new SqlParameter("@Ma_HQ", SqlDbType.Char);
            parameters[0].Size = 6;
            parameters[0].Direction = ParameterDirection.Input;
            parameters[0].Value = maHaiQuan;

            parameters[1] = new SqlParameter("@Ma_DV", SqlDbType.VarChar);
            parameters[1].Size = 14;
            parameters[1].Direction = ParameterDirection.Input;
            parameters[1].Value = maDoanhNghiep;

            parameters[2] = new SqlParameter("@LAN_TL", SqlDbType.Int);
            parameters[2].Direction = ParameterDirection.Input;
            parameters[2].Value = lanthanhly;

            DataSet ds = SqlHelper.ExecuteDataset(connectionString, CommandType.Text, query, parameters);
            return ds;
        }
        public static DataSet GetHoSoThanhKhoan(string maHaiQuan, string maDoanhNghiep)
        {
            string connectionString = ConnectionManager.GetConnectionString("SXXK", maHaiQuan);
            string query = "SELECT * FROM DNPLNTMAN WHERE MA_HQ = @MA_HQ AND MA_DV = @MA_DV ";

            SqlParameter[] parameters = new SqlParameter[2];

            parameters[0] = new SqlParameter("@Ma_HQ", SqlDbType.Char);
            parameters[0].Size = 6;
            parameters[0].Direction = ParameterDirection.Input;
            parameters[0].Value = maHaiQuan;

            parameters[1] = new SqlParameter("@Ma_DV", SqlDbType.VarChar);
            parameters[1].Size = 14;
            parameters[1].Direction = ParameterDirection.Input;
            parameters[1].Value = maDoanhNghiep;

            DataSet ds = SqlHelper.ExecuteDataset(connectionString, CommandType.Text, query, parameters);
            return ds;
        }
    }
}
